﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace MT.ControlLibrary.Controls
{
    public class ButtonWithImage:Button
    {
        //定义图标依赖属性
        public ImageSource BtnIcon
        {
            get { return (ImageSource)GetValue(BtnIconProperty); }
            set { SetValue(BtnIconProperty, value); }
        }

        public static readonly DependencyProperty BtnIconProperty = DependencyProperty.Register("BtnIcon", typeof(ImageSource), typeof(ButtonWithImage), new PropertyMetadata(null));

        static ButtonWithImage()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ButtonWithImage), new FrameworkPropertyMetadata(typeof(ButtonWithImage)));
        }
    }
}
